<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<script src="${pageContext.request.contextPath}/jquery.bootstrap.min.js"></script>
</head>


<body class=" theme-blue">

	<script type="text/javascript">
	function showCheck(){
		$("#boxs").toggle(function(){
			$("#boxs").attr("display","block");
		});
	}
	
	/* function search(){
		 var num = "";
			$("[name='tipCheck']").each(function(){
				if($(this).is(':checked'))
					num = num + $(this).val()+",";
			})
			var searchType = $("#searchType").val();
			searchType = num;
			alert(searchType);
	} */
	
	
	
		$(document).ready(function() {
			/* var num = "";
			var searchTip = $("[name='searchTip']").val();
			$("[name='tipCheck']").each(function(){
				if($(this).is(':checked'))
					num = num + $(this).val()+",";
			})
			alert(num); */
			
			$("#message").delay(1500).slideUp("normal");

			$("#user").click(function() {
				$.confrim({
					title : 'Confirm!',
					content : 'Confirm! Confirm! Confirm!',
					confirm : function() {
						alert('the user clicked confirm');
					},
					cancel : function() {
						alert('the user clicked cancel')
					}
				});
			});

		});

		function isDelete() {
			if (window.confirm("Are you sure delete?"))

				return true;
			else {
				return false;
			}

		}
	</script>

	<div class="content">
		<c:if test="${not empty message}">
			<div id="message" class="alert alert-success">
				<button data-dismiss="alert" class="close">×</button>${message}</div>
		</c:if>


		<div class="header">
			<h1 class="page-title">Students</h1>
			<ul class="breadcrumb">
				<li><a href="index.html">Home</a></li>
				<li class="active">student</li>
			</ul>

		</div>
		<div class="main-content">


			<div class="search-well">
				<form class="form-inline" method="post" style="margin-top: 0px;"
					action="${pageContext.request.contextPath }/stu/search">
					
					<input class="input-xlarge form-control"
						placeholder="Search Help..." id="appendedInputButton"
						name="searchTip" value="${searchTip }" type="text">
						<input type="hidden" id="searchType" name="searchType"/>
						
					<div class="btn-group">
						<button type="submit" class="btn btn-default"><i class="fa fa-search"></i> Go</button>
						<button type="button" class="btn btn-default dropdown-toggle"
							data-toggle="dropdown">
							<span id="tip" style="height:20px; width:60px;" onclick = "showCheck()">tip</span> <span class="sr-only ">切换下拉菜单</span>
						</button>
					</div>
					
					<div style=" border-radius:10px;padding-left:12px;margin-bottom:10px;margin-top:1px;${dplay}border:1px solid #CCC;width:300px;" id="boxs">
							<input type="checkbox" ${check1 } name="tipCheck" value="1"> <spring:message code="stu.stuId" />
							<input type="checkbox" ${check2 } name="tipCheck" value="2"> <spring:message code="stu.stuName" />
							<input type="checkbox" ${check3 } name="tipCheck" value="3"> <spring:message code="stu.stuNumber" />
						</div>
				</form>
			</div>

			<div class="btn-toolbar list-toolbar">
				<button class="btn btn-primary">
					<i class="fa fa-plus"></i> <a
						href="${pageContext.request.contextPath}/stu/add">New User</a>
				</button>
				<button class="btn btn-default">
					<a href="${pageContext.request.contextPath }/upload">Import</a>
				</button>
				<button class="btn btn-default">Export</button>
				<div class="btn-group"></div>
			</div>



			<table class="table-striped  table table-bordered">
				<thead>
					<tr>
						<th id="user"><spring:message code="stu.stuId" /></th>
						<th><spring:message code="stu.stuName" /></th>
						<th><spring:message code="stu.stuNumber" /></th>
						<%-- <th><spring:message code="stu.stuPassword"/></th> --%>
						<th><spring:message code="stu.stuSex" /></th>
						<th><spring:message code="stu.stuBrithday" /></th>
						<th><spring:message code="stu.stuTel" /></th>
						<th><spring:message code="stu.stuAddress" /></th>
						<th><spring:message code="stu.stuDone" /></th>
						<th style="width: 3.5em;" colspan="2"><spring:message
								code="website.operator" /></th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.datas }" var="stu">
						<tr>
							<td>${stu.examStuId }</td>
							<td>${stu.examStuName }</td>
							<td>${stu.examStuNumber }</td>
							<%-- <td>${stu.examStuPassword }</td> --%>
							<td>${stu.examStuSex }</td>
							<td><fmt:formatDate value="${stu.examStuBrithday }"
									pattern="yyyy-MM-dd" /></td>
							<td>${stu.examStuTel }</td>
							<td>${stu.examStuAddress }</td>
							<td>${stu.examStuDone }</td>
							<td><a onclick="return isDelete()"
								href="${pageContext.request.contextPath}/stu/delete/${stu.examStuId }" 
								id="del" role="button" data-toggle="modal"> <i
									class="fa fa-trash-o"></i></a> &nbsp;<a
								href="${pageContext.request.contextPath}/stu/edit/${stu.examStuId}"><i
									class="fa fa-pencil"></i></a></td>
						</tr>
					</c:forEach>


					<tr>
						<td colspan="10"><jsp:include page="/common/page.jsp">
								<jsp:param value="stuList" name="url" />
								<jsp:param value="${page.totalSize }" name="items" />
								<jsp:param value="${page.pageSize }" name="pageSize" />
							</jsp:include></td>
					</tr>
				</tbody>
			</table>
</body>
</html>
